package com.example.mymicaihu.adapter.home;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.example.mvplibrary.adapter.BaseAdapter;
import com.example.mvplibrary.adapter.BaseViewHolder;
import com.example.mymicaihu.R;
import com.example.mymicaihu.bean.GameBean;

import java.util.List;


/**
 * 作者：朱勇闯
 * data : 2021/4/25  17:02
 * 作用： xxxx
 */
public class GameAdapter1 extends BaseAdapter<GameBean.ClassListBean> {
    public ItemListener itemListener;

    public void setItemListener(ItemListener itemListener) {
        this.itemListener = itemListener;
    }

    public GameAdapter1(List<GameBean.ClassListBean> datas, Context context, int layoutId) {
        super(datas, context, layoutId);
    }

    @Override
    protected void bindData(BaseViewHolder holder, GameBean.ClassListBean listBean, int position) {
        TextView name = holder.getView(R.id.tv_item_game_class);
        ImageView iv_img = holder.getView(R.id.iv_item_game_class);
        Glide.with(context).load(listBean.getIconUrl()).into(iv_img);
        name.setText(listBean.getName());
    }

    public interface ItemListener {
        void onItemClickListener(int pos);
    }
}
